#pragma once

#include "API\TESForms\TESForm.h"

#include "Soulgem.h"

#include <string>
using std::string;

class Effect;

class Affix {
	friend class Effect;
public:
	Affix(string affixName, Effect* affixMGEF, const Soulgem& affixSoul);

	string get() const;
	bool set(string newName);
	bool clr();	bool getOnSelf() const;
	bool setOnSelf(const bool newVal);

	bool getNoVars() const;
	bool setNoVars(const bool newVal);

	unsigned int getMinUses() const;
	bool setMinUses(const unsigned int newVal);

	unsigned int getMaxUses() const;
	bool setMaxUses(const unsigned int newVal);

	float getNoDurChance() const;
	bool setNoDurChance(const float newVal);

	float getMinMagPct() const;
	bool setMinMagPct(const float newVal);

	float getMinDurPct() const;
	bool setMinDurPct(const float newVal);

	float getRank() const;
	bool setRank(const float newVal);

	float getFreq() const;
	bool setFreq(const float newVal);

	const bool operator ==(const Affix right) const;
	const bool operator < (const Affix right) const;
	const bool operator <=(const Affix right) const;
	const bool operator > (const Affix right) const;
	const bool operator >=(const Affix right) const;

	const bool operator ==(const string right) const;
	friend const bool operator ==(const string left, const Affix right);
	const bool operator !=(const string right) const;
	friend const bool operator !=(const string left, const Affix right);

	const bool operator ==(const Soulgem& right) const;
	friend const bool operator ==(const Soulgem& left, const Affix right);
	const bool operator !=(const Soulgem& right) const;
	friend const bool operator !=(const Soulgem& left, const Affix right);
	const bool operator < (const Soulgem& right) const;
	friend const bool operator < (const Soulgem& left, const Affix right);
	const bool operator <=(const Soulgem& right) const;
	friend const bool operator <=(const Soulgem& left, const Affix right);
	const bool operator > (const Soulgem& right) const;
	friend const bool operator > (const Soulgem& left, const Affix right);
	const bool operator >=(const Soulgem& right) const;
	friend const bool operator >=(const Soulgem& left, const Affix right);
private:
	string name;
	Effect* mgef;
	const Soulgem* soul;
};
